package br.ufpe.cin.imlm2.jbeat.soot.common.filters;

import soot.FastHierarchy;
import soot.Scene;
import soot.SootClass;

import br.ufpe.cin.imlm2.jbeat.soot.common.CommonExceptions;

/**
 * Retain classes (<code>SootClass</code> objects) which are subtypes of
 * <code>java.lang.Throwable</code> or <code>java.lang.Throwable</code> itself.
 * 
 * @author Irineu
 * 
 */
public class ThrowableFilter extends SootClassFilter {

	@Override
	public boolean retains(SootClass t) {
		FastHierarchy fh = Scene.v().getOrMakeFastHierarchy();
		// XXX Verify correctness.
		return fh.isSubclass(t, CommonExceptions.getTHROWABLE());
	}

}
